SUMMARY = "Realtek rtl8821c COEX Driver"
DESCRIPTION = "Realtek rtl8821c COEX Driver"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

SRC_URI = "file://20200812_LINUX_BT_DRIVER_RTL8821C_COEX_v5050.tgz"

INTERFACE = "usb"
S = "${WORKDIR}/20200812_LINUX_BT_DRIVER_RTL8821C_COEX_v5050/${INTERFACE}/bluetooth_${INTERFACE}_driver"
DEPENDS = "virtual/kernel"

inherit module

EXTRA_OEMAKE  = "ARCH=${ARCH}"
EXTRA_OEMAKE += "KDIR=${STAGING_KERNEL_BUILDDIR}"
EXTRA_OEMAKE += "USER_EXTRA_CFLAGS='-Wno-unused-parameter -Wno-error=sign-compare -Wno-error=maybe-uninitialized -Wno-error=date-time'"


do_install () {
    install -d ${D}/lib/modules/${KERNEL_VERSION}/extra
    install -m 0755 ${B}/rtk_btusb.ko ${D}/lib/modules/${KERNEL_VERSION}/extra/rtk_btusb.ko
	install -d ${D}/lib/firmware
	install -m 0755 ${S}/../../rtkbt-firmware/lib/firmware/rtl8821cu_config ${D}/lib/firmware
	install -m 0755 ${S}/../../rtkbt-firmware/lib/firmware/rtl8821cu_fw ${D}/lib/firmware
}

RPROVIDES_${PN} += "kernel-module-rtl8821c-coex"

FILES_${PN} = " \
        /lib/firmware/rtl8821cu_config \
        /lib/firmware/rtl8821cu_fw \
"